<?php
declare (strict_types=1);

namespace app\common\event\subscribes;

use Swoole\Server;
use think\Event;

class SwooleEventSubscribe
{
    public function subscribe(Event $event)
    {
        // 监听swoole.init事件，设置swoole参数
        $event->listen('swoole.init', function () {
            app(Server::class)->set([
                'max_request'      => 2000,
                'task_max_request' => 500,
            ]);
        });
    }
}